/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trefliq.EJB.webservice;

import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import trefliq.EJB.entities.Orders;
import trefliq.EJB.sessionbeans.OrdersSession;

/**
 *
 * @author dsimmons
 */
//@WebService(serviceName = "OrdersWebService")
@Stateless()
public class OrdersWebService {
    @EJB
    private OrdersSession ejbRef;// Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Web Service Operation")

    @WebMethod(operationName = "createOrder")
    public Orders createOrder(@WebParam(name = "orders") Orders orders) {
        return ejbRef.createOrder(orders);
    }

    @WebMethod(operationName = "getAllOrders")
    public List<Orders> getAllOrders() {
        return ejbRef.getAllOrders();
    }

    @WebMethod(operationName = "getOrderById")
    public Orders getOrderById(@WebParam(name = "orderId") Long orderId) {
        return ejbRef.getOrderById(orderId);
    }

    @WebMethod(operationName = "getOrdersForCustomerId")
    public List<Orders> getOrdersForCustomerId(@WebParam(name = "custId") Long custId) {
        return ejbRef.getOrdersForCustomerId(custId);
    }

    @WebMethod(operationName = "getOrdersByDate")
    public List<Orders> getOrdersByDate(@WebParam(name = "dateCreated") Date dateCreated) {
        return ejbRef.getOrdersByDate(dateCreated);
    }

    @WebMethod(operationName = "getOrdersByStatus")
    public List<Orders> getOrdersByStatus(@WebParam(name = "status") String status) {
        return ejbRef.getOrdersByStatus(status);
    }
    
}
